class Solution:
    def isPowerOfFour(self, num: int) -> bool:
        if num<=0:
            return False
        while num != 0 and num != 1:
            if num == (num >> 2 << 2):
                num = num >> 2
            else:
                return False
        return True


if __name__ == '__main__':
    so = Solution()
    nums1 = -16
    r = so.isPowerOfFour(nums1)
    print(r)
